/*
    1. Write a C program to get the indices of the two numbers of a given array of integers, 
    such that the sum of the two numbers equal to a specific target. 
    Expected Output:

    Original Array: 4  2  1  5  
    Target Value: 7
    Indices of the two numbers whose sum equal to target value: 7
    1 3
*/

#include <stdio.h>

int main(void)
{
    int a[] = {4, 2, 1, 5, 3, 6};
    int len = sizeof(a)/sizeof(int);
    int target = 7;
    int i,j;
    printf("Original Array: ");
    for(i = 0; i < len; i++){
        printf("%d ", a[i]);
    }
    printf("\nTarget value : %d\n", target);
    printf("Indices of the two numbers whose sum equal to target value : %d\n", target);
    for(i = 0; i < len; i++){
        for(j = i + 1; j < len; j++){
            if(target == (a[i] + a[j])){                
                printf("%d %d\n", i, j);
            }
        }
    }

    return 0;
}